package com.dzb.langchain4j.common.config;

import dev.langchain4j.memory.ChatMemory;
import dev.langchain4j.memory.chat.MessageWindowChatMemory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author: dzbiao
 * @CreateTime: 2025/06/08 10:17
 * @Description:
 */
@Configuration
public class MemoryChatAssistantConfig {
    @Bean
    ChatMemory chatMemory() {
        // 设置聊天记忆记录的message数量
        return MessageWindowChatMemory.withMaxMessages(10);
    }

}
